package com.teamwork_backend.mapper;

import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.teamwork_backend.entity.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author windy
 * @since 2021-04-25
 */
public interface UserInfoDao extends BaseMapper<UserInfo> {
    // 这里就是自定义的SQL语句实现联表查询
    // 两个表之间关联操作
    @Select("SELECT * FROM user_info WHERE user_info.userid IN (SELECT userid FROM users WHERE account = #{account})")
    UserInfo getUserInfoByAccount(@Param("account") String account);

}
